from base.graph.NodeFactory import NodeFactory
from base.rdf.impl.LiteralImpl import LiteralImpl

from base.rdf.impl.ResourceImpl import ResourceImpl



class Impl:

    # @Override
    # param
    # result Resource
    def createResource(self):
        return ResourceImpl()

    # @Override
    # param String uriref
    # result Resource
    def createResourceWithUri(self, uriref):
        return ResourceImpl().initWithUri(uriref)

    # @Override
    # param Statement statement
    # result Resource
    def createStmtResource(self, statement):
        return ResourceImpl().initWithStatementAndModelCom(statement, None)

    # @Override
    # param String string
    # result Literal
    def createStringLiteral(self, string):
        return LiteralImpl(NodeFactory.createLiteral(string, ""), None)

    # @Override
    # param String string, String lang
    # result Literal
    def createLangLiteral(self, string, lang):
        return LiteralImpl(NodeFactory.createLiteral(string, lang), None)

    # @Override
    # param String string, RDFDatatype dType
    # result Literal
    def createTypedLiteral(self, string, dType):
        return LiteralImpl(NodeFactory.createLiteral(string, dType), None)

        # @SuppressWarnings("deprecation")

    # @Override
    # param Object value
    # result Literal
    # def createTypedLiteral(self, value):
    #         LiteralLabel ll = None
    #         if (value instanceof Calendar):
    #             Object valuec = XSDDateTime((Calendar) value)
    #             ll = LiteralLabelFactory.createByValue(valuec, "", XSDDatatypeInstances.XSDdateTime)
    #         else:
    #             ll = LiteralLabelFactory.createTypedLiteral(value)
    #
    #     return LiteralImpl(NodeFactory.createLiteral(ll), None)

    # @Override
    # param String uriref
    # result Property
    def createProperty(self, uriref):
        from base.rdf.impl.PropertyImpl import PropertyImpl
        return PropertyImpl().initWithUri(uriref)

    # @Override
    # param String namespace, String localName
    # result Property
    def createPropertyWithNamespaceAndLocalName(self, namespace, localName):
        from base.rdf.impl.PropertyImpl import PropertyImpl
        return PropertyImpl().initWithNamespaceAndLocalName(namespace, localName)

    # @Override
    # param Resource subject, Property predicate RDFNode object
    # result Statement
    def createStatement(self, subject, predicate, obj):
        from base.rdf.impl.StatementImpl import StatementImpl
        return StatementImpl(subject, predicate, obj, None)